import React, {Component} from 'react';
import { HashRouter as Router, Redirect, Route, Switch } from "react-router-dom";

import Layout from "./pages/Layout";
import Login from "./pages/Login";
import Search from "./pages/Search/Search";
import Hobbies from "./pages/About/Hobbies/Hobbies";
import Help from "./pages/About/Help/Help";
// import Rate from "./pages/rating";
import PublishMovieReview from "./components/PublishMovieReview";
import UserInfo from "./pages/About/UserInfo/UserInfo";
import NewsInfo from "./pages/News/newsInfo/NewsInfo";
import MyActor from "./pages/About/Follow/MyActor";
import MyMovie from "./pages/About/Follow/MyMovie";
import MyReview from "./pages/About/Follow/MyReview";
import MovieInfo from './pages/Movie/MovieInfo/MovieInfo';
import ActorInfo from "./pages/Movie/Actor/ActorInfo";
class App extends Component {
    render() {
        return (
            <Router>
                {/* 配置路由 */}
                <Switch>
                    <Route  path="/login" component={Login}/>
                    <Route  path="/search" component={Search}/>
                    <Route  path="/hobbies" component={Hobbies}/>
                    <Route  path="/help" component={Help}/>
                    <Route path={"/publishMovieReview"} component={PublishMovieReview}/>
                    <Route path={"/userInfo"} component={UserInfo}/>
                    <Route path={"/newsInfo"} component={NewsInfo}/>
                    <Route path={"/myActor"} component={MyActor}/>
                    <Route path={"/myMovie"} component={MyMovie}/>
                    <Route path={"/myReview"} component={MyReview}/>
                    <Route path={"/movieInfo"} component={MovieInfo}/>
                    <Route path={"/actorInfo"} component={ActorInfo}/>
                    <Route path={"/userInfo"} component={UserInfo}/>
                    <Route path={"/publishMovieReview"} component={PublishMovieReview}/>
                    <Route exact path="/"  render={() => <Redirect to="/home"/>}/>
                    <Route  path="/" component={Layout}/>
                </Switch>
            </Router>
        );
    }
}

export default App;


